<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:include page="../../common/header.jsp" />
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
jQuery(document).ready(function() {    
});

//校验
function check() {  
 document.getElementById('ok').disabled = 'disabled';  
} 

function backparamslist(){
	$("#paramsform").attr("action","<%=request.getContextPath() %>/sys/parameter/list");
	$("#paramsform").submit();
}
</script>
</head>
<body class="page-header-fixed page-full-width">


		<div class="page-content">

			<div class="container-fluid">

				
				<div class="portlet-body form">
					<c:if test="${success }">
						<div class="alert alert-success">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="success"></spring:message>!</strong> <spring:message code="save success"></spring:message>
							!
						</div>
					</c:if>
					<c:if test="${success==false}">
						<div class="alert alert-failure">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="failure"></spring:message>!</strong> ${errorMsg}
						</div>
					</c:if>

					<h3 class="page-title">
						<c:if test="${sysParameter.sysParameterId==null }"><spring:message
													code="btn.common.add.param"></spring:message></c:if>
						<c:if test="${sysParameter.sysParameterId!=null }"><spring:message
													code="btn.common.edit.param"></spring:message></c:if>
					</h3>

					<form action="<c:if test="${sysParameter.sysParameterId==null}">addparams</c:if>
				<c:if test="${sysParameter.sysParameterId!=null}">editparams</c:if>"
						method="post" class="form-horizontal" id="paramsform"
						onsubmit="return check();">
						<input type="hidden" name="searchValue" value="${searchValue}" />
						<input type="hidden" name="id"
							value="${sysParameter.sysParameterId}"></input> <input
							type="hidden" name="token" value="${token}"></input>

						<div class="control-group">
							<label class="control-label"><spring:message code="param name"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxLength="30" placeholder="请输入参数名"
									<c:if test="${sysParameter.sysParameterId!=null}">disabled="disabled"</c:if>
									name="parametername" value="${sysParameter.parametername }"
									class="m-wrap" required/>
								<c:if test="${sysParameter.sysParameterId!=null}">

									<input type="hidden" name="parametername"
										value="${sysParameter.parametername }"></input>
								</c:if>

								<span class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label"><spring:message code="param value"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxlength="30" name="parametervalue" onkeyup="if(!/^\d+$/.test(this.value)) tip.innerHTML='必须输入数字,且不能有空格.'; else tip.innerHTML='';"
									value="${sysParameter.parametervalue}" class="m-wrap" required/> <span id="tip"
									class="help-inline"></span>

							</div>

						</div>

						<div class="control-group">
							<label class="control-label"><spring:message code="param category"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxlength="30" name="parametercategory" required
									value="${sysParameter.parametercategory}" class="m-wrap" /> <span
									class="help-inline"></span>
							</div>
						</div>

						<div class="control-group">

							<label class="control-label"><spring:message code="enabled"></spring:message>：</label>

							<div class="controls">

								<label class="radio"> <input type="radio"
									<c:if test="${sysParameter.markstatus==1}">checked="checked"</c:if>
									name="markstatus" value="1" /> <spring:message code="yes"></spring:message>

								</label> <label class="radio"> <input type="radio"
									name="markstatus"
									<c:if test="${sysParameter.markstatus==0 || sysParameter.sysParameterId==null}">checked="checked"</c:if>
									value="0" /> <spring:message code="no"></spring:message>

								</label>

							</div>

						</div>


						<div class="control-group">
							<label class="control-label"><spring:message code="note one"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxlength="30" name="note1"
									value="${sysParameter.note1}" class="m-wrap" /> <span
									class="help-inline"></span>
							</div>
						</div>


						<div class="control-group">
							<label class="control-label"><spring:message code="note two"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxlength="30" name="note2"
									value="${sysParameter.note2}" class="m-wrap" /> <span
									class="help-inline"></span>
							</div>
						</div>


						<div class="control-group">
							<label class="control-label"><spring:message code="note three"></spring:message>：</label>
							<div class="controls">

								<input type="text" maxlength="30" name="note3"
									value="${sysParameter.note3}" class="m-wrap" /> <span
									class="help-inline"></span>
							</div>
						</div>

						<div class="form-actions">

							<button type="submit" id="ok" class="btn blue"><spring:message
													code="btn.common.save"></spring:message></button>
							<button type="button" onclick="backparamslist();" class="btn"><spring:message
													code="btn.common.back"></spring:message></button>

						</div>


					</form>

				</div>


			</div>
		</div>


</body>
</html>